package com.atguigu.netty.dubborpc.customer;

import com.atguigu.netty.dubborpc.netty.NettyClient;
import com.atguigu.netty.dubborpc.publicinterface.HelloService;

public class ClientBootstrap {

    //这里定义协议头
    public static String PROVIDER_NAME = "HelloService#hello#";

    public static void main(String[] args) {

        //创建一个消费者
        NettyClient consumer = new NettyClient();

        //创建代理对象
        HelloService helloService = (HelloService) consumer.getBean(HelloService.class,PROVIDER_NAME);

        //通过代理对象调用服务提供者的方法（服务）
        String res = helloService.hello("hello dubbo~");
        System.out.println("调用的结果 res =" + res);
    }
}
